
import 'package:framelib/base/base_service.dart';
import 'package:framelib/net/baseentity.dart';
import 'package:module_business/module_chat/model/gift_entity.dart';
import 'package:module_business/module_comm/model/comm_entity_factory.dart';
import 'package:module_business/module_comm/model/country_entity.dart';
import 'package:module_business/module_comm/model/user_entity.dart';
import 'package:module_business/module_index/model/index_room_item_entity.dart';
import 'package:module_business/module_my/model/my_entity_factory.dart';

import 'net/my_api.dart';
import 'net/my_net_utils.dart';

/**
 * ModuleMy 网络层
 */
class ModuleMyService with BaseService{

  //获取用户自己的信息
  Future<BaseEntity> api_user_getUserInfo({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_getUserInfo,isList: false,
    );
  }
  //根据用户ID搜索用户
  Future<BaseEntity> api_user_querySimpleUserById({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_querySimpleUserById,
      params: parmsMap,isList: false,
    );
  }
  //更新用户自己的信息
  Future<BaseEntity> api_user_updateUserInfo({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_updateUserInfo ,
      params: parmsMap,isList: false,
    );
  }

  Future<BaseEntity> api_user_userFriend({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_userFriend ,
      params: parmsMap,isList: true,
    );
  }

  Future<BaseEntity> api_user_followUser({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<BaseEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_followUser ,
      params: parmsMap,isList: false,
    );
  }
  //拉黑用户列表
  Future<BaseEntity> api_user_blackList({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_blackList ,
      params: parmsMap,isList: true,
    );
  }

  //拉黑或移除拉黑
  Future<BaseEntity> api_user_BlackOrRemove({Map<String, dynamic> parmsMap,isBlack}) async {
    return await MyNetUtils.instance.postData<BaseEntity,MyEntityFactory>
      (MyEntityFactory.instance,
        (isBlack??false)?MyApi.instance.api_user_blockUser
            :MyApi.instance.api_user_removeBlockUser,
      params: parmsMap,isList: false,
    );
  }
  //删除账号
  Future<BaseEntity> api_user_deleteAccount({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<UserEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_user_deleteAccount ,
      params: parmsMap,isList: false,
    );
  }
  //查询用户礼物墙,seacrhValue 传userId查指定用户,不传查自己
  Future<BaseEntity> api_voicechat_gift_giftWall({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<GiftEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_voicechat_gift_giftWall ,
      params: parmsMap,isList: true,
    );
  }
  //获取礼物列表
  Future<BaseEntity> api_voicechat_gift_list({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<GiftEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_voicechat_gift_list ,
      params: parmsMap,isList: true,
    );
  }
  //赠送礼物
  Future<BaseEntity> api_voicechat_gift_sendGift({Map<String, dynamic> parmsMap}) async {
    return await MyNetUtils.instance.postData<BaseEntity,MyEntityFactory>
      (MyEntityFactory.instance,MyApi.instance.api_voicechat_gift_sendGift ,
      params: parmsMap,isList: false,
    );
  }
}
